/*
 * 课程管理模块
 */


export function getCourseCateList(params) {
  const data = {
    "code": 200,
    "msg": null,
    "data": {
      "count": 13,
      "list": [{
        "id": 73,
        "companyId": null,
        "courseCateName": "德语",
        "cateIcon": "",
        "parentCateId": null,
        "createTime": "2020-11-01 15:07:07",
        "creator": 1,
        "isDelete": 0
      }, {
        "id": 72,
        "companyId": null,
        "courseCateName": "法语",
        "cateIcon": "",
        "parentCateId": null,
        "createTime": "2020-11-01 15:05:42",
        "creator": 1,
        "isDelete": 0
      }, {
        "id": 71,
        "companyId": null,
        "courseCateName": "教育",
        "cateIcon": null,
        "parentCateId": null,
        "createTime": "2020-11-01 15:04:55",
        "creator": 1,
        "isDelete": 0
      }, {
        "id": 70,
        "companyId": null,
        "courseCateName": "体育",
        "cateIcon": "",
        "parentCateId": null,
        "createTime": "2020-11-01 15:04:00",
        "creator": 1,
        "isDelete": 0
      }, {
        "id": 69,
        "companyId": null,
        "courseCateName": "语文",
        "cateIcon": "",
        "parentCateId": null,
        "createTime": "2020-11-01 14:59:57",
        "creator": 1,
        "isDelete": 0
      }, {
        "id": 68,
        "companyId": null,
        "courseCateName": "英语",
        "cateIcon": "",
        "parentCateId": null,
        "createTime": "2020-11-01 14:58:56",
        "creator": 1,
        "isDelete": 0
      }, {
        "id": 67,
        "companyId": null,
        "courseCateName": "数学",
        "cateIcon": "",
        "parentCateId": null,
        "createTime": "2020-11-01 14:57:11",
        "creator": 1,
        "isDelete": 0
      }, {
        "id": 66,
        "companyId": null,
        "courseCateName": "物理",
        "cateIcon": "",
        "parentCateId": null,
        "createTime": "2020-11-01 14:56:18",
        "creator": 1,
        "isDelete": 0
      }, {
        "id": 62,
        "companyId": null,
        "courseCateName": "心理",
        "cateIcon": null,
        "parentCateId": null,
        "createTime": "2020-11-01 14:49:46",
        "creator": 1,
        "isDelete": 0
      }]
    }
  }
  if (params && params.parentCateId) {
    data.data = {
      "count": 4,
      "list": [{
        "id": 106,
        "companyId": null,
        "courseCateName": "数学4",
        "cateIcon": "/upload/default/201108145212308.png",
        "parentCateId": 67,
        "createTime": "2020-11-08 14:52:13",
        "creator": 1,
        "isDelete": 0
      }, {
        "id": 105,
        "companyId": null,
        "courseCateName": "数学3",
        "cateIcon": "/upload/default/201108145203542.png",
        "parentCateId": 67,
        "createTime": "2020-11-08 14:52:05",
        "creator": 1,
        "isDelete": 0
      }, {
        "id": 104,
        "companyId": null,
        "courseCateName": "数学2",
        "cateIcon": "/upload/default/201108145154886.png",
        "parentCateId": 67,
        "createTime": "2020-11-08 14:51:56",
        "creator": 1,
        "isDelete": 0
      }, {
        "id": 103,
        "companyId": null,
        "courseCateName": "数学1",
        "cateIcon": "/upload/default/201108145146933.png",
        "parentCateId": 67,
        "createTime": "2020-11-08 14:51:48",
        "creator": 1,
        "isDelete": 0
      }]
    }
  }
  return {
    url: 'course/getCourseCateList',
    type: 'post',
    data: data
  }
}

export function getCourseCateTree() {
  const data = {
    "code": 200,
    "msg": null,
    "data": [
      {
        "id": 129, "name": "职业素养",
        "children": [
          {"id": 157, "name": "逻辑思维", "pid": 129},
          {"id": 156, "name": "职场关系", "pid": 129},
          {"id": 155, "name": "职场形象", "pid": 129},
          {"id": 154, "name": "商务礼仪", "pid": 129},
          {"id": 153, "name": "商业写作", "pid": 129},
          {"id": 152, "name": "演讲技巧", "pid": 129},
          {"id": 144, "name": "沟通管理", "pid": 129},
          {"id": 143, "name": "时间管理", "pid": 129}
        ]
      },
      {
        "id": 116, "name": "互联网",
        "children": [
          {"id": 119, "name": "编程", "pid": 116},
          {"id": 118, "name": "UI设计", "pid": 116},
          {"id": 117, "name": "交互设计", "pid": 116}
        ]
      },
      {
        "id": 114, "name": "李敏测试",
        "children": [
          {"id": 115, "name": "李敏测试", "pid": 114}
        ]
      },
      {
        "id": 108, "name": "互联网",
        "children": [
          {"id": 112, "name": "编程", "pid": 108},
          {"id": 111, "name": "UI设计", "pid": 108},
          {"id": 110, "name": "产品设计", "pid": 108},
          {"id": 109, "name": "交互设计", "pid": 108}
        ]
      },
      {
        "id": 88, "name": "分类一",
        "children": [
          {"id": 90, "name": "分类四", "pid": 88},
          {"id": 89, "name": "分裂三", "pid": 88}
        ]
      },
      {
        "id": 69, "name": "语文",
        "children": [
          {"id": 86, "name": "现代文字", "pid": 69},
          {"id": 85, "name": "古代文学", "pid": 69}
        ]
      },
      {
        "id": 68, "name": "英语",
        "children": [
          {"id": 84, "name": "口语", "pid": 68},
          {"id": 83, "name": "写作", "pid": 68},
          {"id": 82, "name": "阅读", "pid": 68}
        ]
      },
      {
        "id": 67, "name": "数学",
        "children": [
          {"id": 106, "name": "数学4", "pid": 67},
          {"id": 105, "name": "数学3", "pid": 67},
          {"id": 104, "name": "数学2", "pid": 67},
          {"id": 103, "name": "数学1", "pid": 67}
        ]
      },
      {
        "id": 66, "name": "物理",
        "children": [
          {"id": 102, "name": "试试", "pid": 66},
          {"id": 101, "name": "很难得", "pid": 66},
          {"id": 100, "name": "真的", "pid": 66},
          {"id": 99, "name": "很难", "pid": 66}
        ]
      },
      {
        "id": 62, "name": "心理",
        "children": [
          {"id": 94, "name": "金钱管理", "pid": 62},
          {"id": 93, "name": "情绪管理", "pid": 62},
          {"id": 92, "name": "时间管理", "pid": 62},
          {"id": 91, "name": "开始", "pid": 62}
        ]
      }]
  }
  return {
    url: 'course/getCourseCateTree',
    type: 'post',
    data: data
  }
}

export function getCourseList(params) {
  const data = {
    "code": 200,
    "msg": 11,
    "data": {}
  }
  data.data = {
    "count": 6,
    "list": [{
      "id": 36,
      "companyId": null,
      "courseCateId": 87,
      "companyCateId": null,
      "courseType": 2,
      "courseName": "你看没你看没看了",
      "summary": "买空卖空麦科勒姆",
      "face": "/upload/default/201105204741745.jpg",
      "memo": "<h1>卡罗拉开模了联考吗</h1><p><i>我多增加几个列表</i></p><ol><li><i>测试顺序</i></li></ol>",
      "courseLabel": "类目开了",
      "lockMode": null,
      "unlockDay": null,
      "liveUrl": null,
      "liveDuration": null,
      "liveAllowReplay": null,
      "outBeginTime": null,
      "outEndTime": null,
      "outAddress": "联康；麦科勒姆了",
      "outFee": 899.0,
      "supplierId": 6,
      "isRelease": 1,
      "createTime": "2020-11-08 00:00:00",
      "creator": 1,
      "isDelete": 0,
      "companyName": null,
      "courseCateName": "国际关系",
      "supplierName": null,
      "companyCourseId": null,
      "companyCourseIsRelease": null,
      "parentCateId": null,
      "parentCateName": null
    }, {
      "id": 23,
      "companyId": null,
      "courseCateId": 74,
      "companyCateId": null,
      "courseType": 2,
      "courseName": "pdf测试",
      "summary": "pdf测试",
      "face": "/upload/default/201104153048370.jpg",
      "memo": "<p>pdf测试pdf测试</p>",
      "courseLabel": "pdf测试",
      "lockMode": null,
      "unlockDay": null,
      "liveUrl": null,
      "liveDuration": null,
      "liveAllowReplay": null,
      "outBeginTime": "2020-11-19 00:00:00",
      "outEndTime": "2020-12-31 00:00:00",
      "outAddress": "pdf测试",
      "outFee": 200.0,
      "supplierId": 4,
      "isRelease": 1,
      "createTime": "2020-11-05 10:44:42",
      "creator": 1,
      "isDelete": 0,
      "companyName": null,
      "courseCateName": "意大利语",
      "supplierName": "test1",
      "companyCourseId": null,
      "companyCourseIsRelease": null,
      "parentCateId": null,
      "parentCateName": null
    }, {
      "id": 19,
      "companyId": null,
      "courseCateId": 71,
      "companyCateId": null,
      "courseType": 2,
      "courseName": "阿道夫",
      "summary": "阿道夫",
      "face": "",
      "memo": "<p>阿斯蒂芬</p>",
      "courseLabel": "ddf",
      "lockMode": null,
      "unlockDay": null,
      "liveUrl": null,
      "liveDuration": null,
      "liveAllowReplay": null,
      "outBeginTime": "2020-11-01 00:00:00",
      "outEndTime": "2020-11-18 00:00:00",
      "outAddress": "安抚",
      "outFee": 1212.0,
      "supplierId": 4,
      "isRelease": 1,
      "createTime": "2020-11-08 20:26:18",
      "creator": 1,
      "isDelete": 0,
      "companyName": null,
      "courseCateName": "教育",
      "supplierName": "test1",
      "companyCourseId": null,
      "companyCourseIsRelease": null,
      "parentCateId": null,
      "parentCateName": null
    }, {
      "id": 18,
      "companyId": null,
      "courseCateId": 68,
      "companyCateId": null,
      "courseType": 2,
      "courseName": "eqwr",
      "summary": "qwerqre",
      "face": "",
      "memo": "<p>qwerwer</p>",
      "courseLabel": "asdf",
      "lockMode": null,
      "unlockDay": null,
      "liveUrl": null,
      "liveDuration": null,
      "liveAllowReplay": null,
      "outBeginTime": "2020-11-01 00:00:00",
      "outEndTime": "2020-11-30 00:00:00",
      "outAddress": "asfadf",
      "outFee": 121212.0,
      "supplierId": 4,
      "isRelease": 1,
      "createTime": "2020-11-08 20:26:19",
      "creator": 1,
      "isDelete": 0,
      "companyName": null,
      "courseCateName": "英语",
      "supplierName": "test1",
      "companyCourseId": null,
      "companyCourseIsRelease": null,
      "parentCateId": null,
      "parentCateName": null
    }, {
      "id": 10,
      "companyId": null,
      "courseCateId": 14,
      "companyCateId": null,
      "courseType": 2,
      "courseName": "外训课程测试",
      "summary": "外训课程测试",
      "face": "/upload/default/201031151346854.jpg",
      "memo": "<p>外训课程测试</p>",
      "courseLabel": "健身",
      "lockMode": null,
      "unlockDay": null,
      "liveUrl": null,
      "liveDuration": null,
      "liveAllowReplay": null,
      "outBeginTime": "2020-10-07 00:00:00",
      "outEndTime": "2020-10-28 00:00:00",
      "outAddress": "火焰山",
      "outFee": 1000.0,
      "supplierId": 1,
      "isRelease": null,
      "createTime": "2020-11-01 17:31:21",
      "creator": 1,
      "isDelete": 0,
      "companyName": null,
      "courseCateName": "99",
      "supplierName": "供应商",
      "companyCourseId": null,
      "companyCourseIsRelease": null,
      "parentCateId": null,
      "parentCateName": null
    }, {
      "id": 2,
      "companyId": null,
      "courseCateId": 1,
      "companyCateId": null,
      "courseType": 2,
      "courseName": "课程名称",
      "summary": "课程摘要课程摘要课程摘要课程摘要",
      "face": "/upload/default/201030213537183.jpg",
      "memo": "",
      "courseLabel": "职业技能,情绪管理,心理学习",
      "lockMode": null,
      "unlockDay": null,
      "liveUrl": null,
      "liveDuration": null,
      "liveAllowReplay": null,
      "outBeginTime": "2020-10-01 00:00:00",
      "outEndTime": "2020-10-31 00:00:00",
      "outAddress": "杭州",
      "outFee": 1000.0,
      "supplierId": 1,
      "isRelease": 1,
      "createTime": "2020-11-08 20:26:21",
      "creator": 1,
      "isDelete": 0,
      "companyName": null,
      "courseCateName": null,
      "supplierName": "供应商",
      "companyCourseId": null,
      "companyCourseIsRelease": null,
      "parentCateId": null,
      "parentCateName": null
    }]
  }
  return {
    url: 'course/getCourseList',
    type: 'post',
    data: data
  }
}

export function getAttachment() {
  const attachmentList = [{
    "id": 12,
    "courseId": 46,
    "fileId": 338,
    "createTime": "2020-11-12 00:12:53",
    "creator": 1,
    "isDelete": 0,
    "fileName": "接口文档.txt",
    "fileType": 4,
    "filePath": "/upload/default/201112001252026.txt",
    "fileCode": null
  }]
  return {
    url: 'course/getAttachment',
    type: 'post',
    data: {
      "code": 200,
      "msg": 333,
      data: attachmentList
    }
  }
}

export function getCourse(params) {
  const courseData = {
    "code": 200,
    "msg": 22,
    "data": {
      "id": 36,
      "companyId": null,
      "courseCateId": 87,
      "companyCateId": null,
      "courseType": 2,
      "courseName": "你看没你看没看了",
      "summary": "买空卖空麦科勒姆",
      "face": "http://mego-haina.oss-cn-hangzhou.aliyuncs.com/upload/default/201112001228948.jpg",
      "memo": "<h1>卡罗拉开模了联考吗</h1><p><i>我多增加几个列表</i></p><ol><li><i>测试顺序</i></li></ol>",
      "courseLabel": "类目开了",
      "lockMode": null,
      "unlockDay": null,
      "liveUrl": null,
      "liveDuration": null,
      "liveAllowReplay": null,
      "outBeginTime": null,
      "outEndTime": null,
      "outAddress": "联康；麦科勒姆了",
      "outFee": 899.0,
      "supplierId": 6,
      "isRelease": 1,
      "createTime": "2020-11-08 00:00:00",
      "creator": 1,
      "isDelete": 0,
      "companyName": null,
      "courseCateName": "国际关系",
      "supplierName": null,
      "companyCourseId": null,
      "companyCourseIsRelease": null,
      "parentCateId": null,
      "parentCateName": null
    }
  }

  return {
    url: 'course/getCourse',
    type: 'post',
    data: courseData

  }
}

export function getCourseItem() {
  const data = [{
    "id": 192,
    "itemType": 1,
    "parentItemId": null,
    "courseId": 56,
    "resourceId": null,
    "chapterMemo": "大大",
    "sortIndex": 1,
    "chapterTitle": "大师傅",
    "resourceType": null,
    "resourceName": null,
    "memo": null,
    "courseName": "答复",
    "fileName": null,
    "fileType": null,
    "face": null,
    "teacherName": null,
    "headimg": null,
    "fileCode": null,
    "filePath": null,
    "courseItemList": []
  }, {
    "id": 193,
    "itemType": 2,
    "parentItemId": 192,
    "courseId": 56,
    "resourceId": 24,
    "chapterMemo": null,
    "sortIndex": 1,
    "chapterTitle": null,
    "resourceType": 1,
    "resourceName": "这是啥东西",
    "memo": null,
    "courseName": "答复",
    "fileName": "1.mp4",
    "fileType": 1,
    "face": "/upload/default/201113153028042.jpeg",
    "teacherName": "么么哒",
    "headimg": "/upload/default/201113231238854.jpg",
    "fileCode": "284a0754e246bbb9a18a406289e983b2_2",
    "filePath": null,
    "courseItemList": []
  }]
  return {
    url: 'course/getCourseItem',
    type: 'post',
    data: {
      "code": 200,
      "msg": null,
      data: data
    }
  }
}


export function getCourseTeacher() {
  const data = [{
    "id": 136,
    "courseId": 36,
    "teacherId": 28,
    "isMaster": 0,
    "teacherName": "么么哒",
    "direction": "这个,那个",
    "supplierName": "海纳云平台",
    "headimg": "/upload/default/201113231238854.jpg"
  }, {
    "id": 132,
    "courseId": 36,
    "teacherId": 26,
    "isMaster": 1,
    "teacherName": "阿斯蒂芬",
    "direction": "健康学,科技",
    "supplierName": "供应商1",
    "headimg": "/upload/default/201031204913386.jpeg"
  }]
  return {
    url: 'course/getCourseTeacher',
    type: 'post',
    data: {
      "code": 200,
      "msg": null,
      data: data
    }
  }
}
